package jay.home.bet.web.struts;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.DynaActionForm;

public class SelectRaceAction extends BaseAction
{
	public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response ) throws Exception
	{
		DynaActionForm selectRaceForm = ( DynaActionForm ) form;
		
		String raceType = ( String )selectRaceForm.get("raceType");
		List teams = super.getBasicService().getTeamsByLeague( raceType );
		request.setAttribute("teams", teams );
		return mapping.findForward("SUCCESS");
	}
}
